import request from '@/utils/request'
// 新增保存生产者补贴申请
export function addProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/submitnongye',
    method: 'post',
    data: data
  })
}

//修改农业申请
export function updateProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting',
    method: 'put',
    data: data
  })
}

//一键提交各类型补贴，村，乡
export function submitProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/submitAll',
    method: 'post',
    data: data
  })
}

// 查询补贴申请列表
export function listProduce(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/listyy',
    method: 'get',
    params: query
  })
}

// 查询补贴申请详细 by id
export function getProduceById(id) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/' + id,
    method: 'get'
  })
}

//查询补贴详情 by appnum
export function getProduceByappNum(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/selectOne',
    method: 'get',
    params: query
  })
}

//一键驳回生产者补贴
export function rejectAllProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/rejectAll',
    method: 'post',
    data: data
  })
}

//单个驳回生产者补贴，通过appNum
export function rejectProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/rejectOne',
    method: 'post',
    data: data
  })
}

// 单个审核通过，通过appNum
export function approveProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/approveOne',
    method: 'post',
    data: data
  })
}
//批量审核通过，通过appNum
export function approveBatchProduce(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/approveOneBatch',
    method: 'post',
    data: data
  })
}

//保存各类补贴类型金额
export function savePrice(data) {
  return request({
    url: '/subsidy/plantingPrice',
    method: 'post',
    data: data
  })
}

//查询所有村或者所有乡的不同类型的汇总数据
export function queryGroupData(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/getAmountGroup',
    method: 'get',
    params: query
  })
}



//查询农业补贴金额标准
export function getPrice(query) {
  return request({
    url: '/subsidy/plantingPrice/listAll',
    method: 'get',
    params: query
  })
}

//查看乡请示文件，并查看驳回理由和标识
export function queryTownRes(query) {
  return request({
    url: '/subsidy/plantingTownttach/list',
    method: 'get',
    params: query
  })
}

//模糊查询大豆种类
export function queryDadouType(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/listDadou',
    method: 'get',
    params: query
  })
}

//模糊查询村负责人
export function queryCunCharge(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/getCunCharge',
    method: 'get',
    params: query
  })
}

//根据身份证查询申请人信息
export function queryhistoryOne(query) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/historyOne',
    method: 'get',
    params: query
  })
}


//一键处理补贴发放
export function submitSub(data) {
  return request({
    url: '/subsidy/subsidyApplicationPlanting/submitPriceAll',
    method: 'post',
    data: data
  })
}

// 删除补贴申请
export function delSubsidyApplication(ids) {
  return request({
    // url: '/subsidy/subsidyApplicationPlanting/' + id,
    url: `/subsidy/subsidyApplicationPlanting/${ids}`,
    method: 'delete'
  })
}


